W3C Web Annotation Model

Model / Vocabulary

Model: https://www.w3.org/TR/annotation-model/

Vocabulary: http://www.w3.org/TR/annotation-vocab/

Basics

The core model is simple.

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno1",
"type": "Annotation",
"body": "http://example.org/post1",
"target": "http://example.com/page1"
}

N.B. there can be more than one body, and more than one target. Both body and target can be a list/array.

However, the W3C Model assumes for an annotation that all bodies and targets apply equally to each other. So, if there are multiple bodies, it's assumed that all bodies apply to the target. If there are multiple targets, it's assumed that all of the bodies are being annotated on all of the targets.

Types of Body

External Web Resource

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno2",
"type": "Annotation",
"body": {
"id": "http://example.org/analysis1.mp3",
"format": "audio/mpeg",
"language": "fr"
}
...

format: the rfc6838 media-type of the resource
language: the language of the resource
id: the URI for the resource

It can also be useful to give:

type for the resource.

Class Description
Dataset Resource which encodes data in a defined structure.
Image Image resources, primarily intended to be seen.
Video Video resources, with or without audio.
Sound Resource primarily intended to be heard.
Text Resource primarily intended to be read.

Embedded TextualBody

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno5",
"type": "Annotation",
"body": {
"type" : "TextualBody",
"value" : "<p>j'adore !</p>",
"format" : "text/html",
"language" : "fr"
},
"target": "http://example.org/photo1"
}

String Body

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno6",
"type": "Annotation",
"bodyValue": "Comment text",
"target": "http://example.org/target1"
}

Targets

Targets are often External Web Resources, too. Carrying the same properties as above.

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno3",
"type": "Annotation",
"body": {
"id": "http://example.org/video1",
"type": "Video"
},
"target": {
"id": "http://example.org/website1",
"type": "Text"
}
}

Fragments of resources

N.B. fragments can be used with both Bodies and Targets. For example, to tag a fragment of an image, with a fragment of some text. Or to tag a document with a temporal fragment of a video commentary, etc.

Media Fragments

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno4",
"type": "Annotation",
"body": "http://example.org/description1",
"target": {
"id": "http://example.com/image1#xywh=100,100,300,300",
"type": "Image",
"format": "image/jpeg"
}
}

Or in a more expanded form, using SpecificResource:

// PUT EXAMPLE HERE WITH IMAGE SELECTOR

Or a section of time:

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno20",
"type": "Annotation",
"body": {
"source": "http://example.org/video1",
"purpose": "describing",
"selector": {
"type": "FragmentSelector",
"conformsTo": "http://www.w3.org/TR/media-frags/",
"value": "t=30,60"
}
},
"target": "http://example.org/image1"
}

Text Position Selector

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno24",
"type": "Annotation",
"body": "http://example.org/review1",
"target": {
"source": "http://example.org/ebook1",
"selector": {
"type": "TextPositionSelector",
"start": 412,
"end": 795
}
}
}

Motivation and Purpose

As with the Open Annotation model, the W3C Model provides a way of indicating the motivation for an annotation.

However, in addition to motivation the W3C Model introduces the notion of purpose.

Purpose

Purpose uses the same vocabulary as motivation but applies to an individual annotation body, rather than the entire annotation.

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno15",
"type": "Annotation",
"motivation": "bookmarking",
"body": [
{
"type": "TextualBody",
"value": "readme",
"purpose": "tagging"
},
{
"type": "TextualBody",
"value": "A good description of the topic that bears further investigation",
"purpose": "describing"
}
],
"target": "http://example.com/page1"
}

Lifecyle Information

It is also possible to add information about the creator, lifecyle, etc. of an annotation.

Class Description
creator The agent responsible for creating the resource. This may be either a human, an organization or a software agent.
created The time at which the resource was created.
generator The agent responsible for serializing the resource.
generated The time at which the Annotation serialization was generated.
modified The time at which the resource was modified, after creation.

Example:

{
"@context": "http://www.w3.org/ns/anno.jsonld",
"id": "http://example.org/anno11",
"type": "Annotation",
"creator": "http://example.org/user1",
"created": "2015-01-28T12:00:00Z",
"modified": "2015-01-29T09:00:00Z",
"generator": "http://example.org/client1",
"generated": "2015-02-04T12:00:00Z",
"body": {
"id": "http://example.net/review1",
"creator": "http://example.net/user2",
"created": "2014-06-02T17:00:00Z"
},
"target": "http://example.com/restaurant1"
}

Further detailed information can be provided about:

Agents

Human or software agents responsible for the creation or generation of an annotation resource.

Class Description
id The IRI that identifies the agent.
type Type of Agent.
Person Class for a Human Agent.
Organization Class for an Organization.
Software Class for Software
name Name of agent.
nickname Nickname of agent.
email Email of agent.
email_sha1 Hash of email of agent.
homepage Homepage of agent.